package ar.utn.frba.ia.IA_TP1.mapas;

import java.util.ArrayList;

public class AmericaDelNorte extends Mapa {

	@Override
	protected void fillPaises() {
		this.paises = new ArrayList<Pais>();
		this.paises.add(new Pais(6,"Canada",15,19));
		this.paises.add(new Pais(7,"YuKon",8,28));
		this.paises.add(new Pais(8,"Alaska",3,35));
//		this.paises.add(new Pais(3,"Groenlandia",50,50));
		this.paises.add(new Pais(9,"Oregon",8,40));
		this.paises.add(new Pais(10,"California",15,40));
		this.paises.add(new Pais(11,"Mexico",21,47));
		this.paises.add(new Pais(12,"New York",19,35));
		this.paises.add(new Pais(13,"Terranova",21,30));
		this.paises.add(new Pais(14,"Labrador",25,25));
		
	}

	@Override
	protected void fillMatrizAdy() {
		
		this.matrizAdy[PaisesAmN.CANADA.toInt()][PaisesAmN.CANADA.toInt()] = true;
		this.matrizAdy[PaisesAmN.CANADA.toInt()][PaisesAmN.YUKON.toInt()] = true;
		this.matrizAdy[PaisesAmN.CANADA.toInt()][PaisesAmN.OREGON.toInt()] = true;
		this.matrizAdy[PaisesAmN.CANADA.toInt()][PaisesAmN.NEWYORK.toInt()] = true;
		this.matrizAdy[PaisesAmN.CANADA.toInt()][PaisesAmN.TERRANOVA.toInt()] = true;
		
		this.matrizAdy[PaisesAmN.YUKON.toInt()][PaisesAmN.YUKON.toInt()] = true;
		this.matrizAdy[PaisesAmN.YUKON.toInt()][PaisesAmN.OREGON.toInt()] = true;
		this.matrizAdy[PaisesAmN.YUKON.toInt()][PaisesAmN.CANADA.toInt()] = true;
		
		this.matrizAdy[PaisesAmN.ALASKA.toInt()][PaisesAmN.ALASKA.toInt()] = true;
		this.matrizAdy[PaisesAmN.ALASKA.toInt()][PaisesAmN.YUKON.toInt()] = true;
		this.matrizAdy[PaisesAmN.ALASKA.toInt()][PaisesAmN.OREGON.toInt()] = true;
		
		this.matrizAdy[PaisesAmN.OREGON.toInt()][PaisesAmN.OREGON.toInt()] = true;
		this.matrizAdy[PaisesAmN.OREGON.toInt()][PaisesAmN.ALASKA.toInt()] = true;
		this.matrizAdy[PaisesAmN.OREGON.toInt()][PaisesAmN.YUKON.toInt()] = true;
		this.matrizAdy[PaisesAmN.OREGON.toInt()][PaisesAmN.CANADA.toInt()] = true;
		this.matrizAdy[PaisesAmN.OREGON.toInt()][PaisesAmN.NEWYORK.toInt()] = true;
		this.matrizAdy[PaisesAmN.OREGON.toInt()][PaisesAmN.CALIFORNIA.toInt()] = true;
		
		this.matrizAdy[PaisesAmN.CALIFORNIA.toInt()][PaisesAmN.CALIFORNIA.toInt()] = true;
		this.matrizAdy[PaisesAmN.CALIFORNIA.toInt()][PaisesAmN.OREGON.toInt()] = true;
		this.matrizAdy[PaisesAmN.CALIFORNIA.toInt()][PaisesAmN.NEWYORK.toInt()] = true;
		this.matrizAdy[PaisesAmN.CALIFORNIA.toInt()][PaisesAmN.MEXICO.toInt()] = true;
		
		this.matrizAdy[PaisesAmN.MEXICO.toInt()][PaisesAmN.MEXICO.toInt()] = true;
		this.matrizAdy[PaisesAmN.MEXICO.toInt()][PaisesAmN.CALIFORNIA.toInt()] = true;

		//TODO ver problema con colombia resolver en la funcion de fitness o ignorar porque es de otro continengte
		// y restringir el problema a paises adjacentes de cada continente
		//O poner las americas en una sola clase mapa y cambiar el cromosoma para que tenga uno menos
		
		this.matrizAdy[PaisesAmN.NEWYORK.toInt()][PaisesAmN.NEWYORK.toInt()] = true;
		this.matrizAdy[PaisesAmN.NEWYORK.toInt()][PaisesAmN.TERRANOVA.toInt()] = true;
		this.matrizAdy[PaisesAmN.NEWYORK.toInt()][PaisesAmN.CANADA.toInt()] = true;
		this.matrizAdy[PaisesAmN.NEWYORK.toInt()][PaisesAmN.OREGON.toInt()] = true;
		this.matrizAdy[PaisesAmN.NEWYORK.toInt()][PaisesAmN.CALIFORNIA.toInt()] = true;
		
		this.matrizAdy[PaisesAmN.TERRANOVA.toInt()][PaisesAmN.TERRANOVA.toInt()] = true;
		this.matrizAdy[PaisesAmN.TERRANOVA.toInt()][PaisesAmN.LABRADOR.toInt()] = true;
		this.matrizAdy[PaisesAmN.TERRANOVA.toInt()][PaisesAmN.CANADA.toInt()] = true;
		this.matrizAdy[PaisesAmN.TERRANOVA.toInt()][PaisesAmN.NEWYORK.toInt()] = true;
		
		this.matrizAdy[PaisesAmN.LABRADOR.toInt()][PaisesAmN.LABRADOR.toInt()] = true;
		this.matrizAdy[PaisesAmN.LABRADOR.toInt()][PaisesAmN.TERRANOVA.toInt()] = true;
		
	}

	public enum PaisesAmN{
		CANADA(0),
		YUKON(1),
		ALASKA(2),
//		GROENLANDIA(3),
		OREGON(3),
		CALIFORNIA(4),
		MEXICO(5),
		NEWYORK(6),
		TERRANOVA(7),
		LABRADOR(8);
		
		private int numero;
		
		private PaisesAmN(int n){
			numero = n;
		}
		
		public int toInt(){
			return numero;
		}

	}
	
	
}
